00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00051 define("PATH_TO_ROOT", "../../");
00053 require_once (PATH_TO_ROOT."common/init.inc.php");
00054 if (isset($_POST['Cancel'])) {
00055 header("Location: ".$_SERVER['PHP_SELF']);
00056 exit;
00057 }
00059 require_once (PATH_TO_ROOT."common/header.inc.php");
00060 include_once ('./classes/class.adminfunctions.inc.php');
00061 include_once ('../classes/class.photofunctions.inc.php');
00062 include_once "../header.inc.php";
00064 require_once (PATH_TO_ROOT."common/tinymceconfig.inc.php");
00065 global $js;
00066 $eStudyPage->appendJavaScriptFile($js);
00067 writeContentHeader("Fotoalbum erstellen");
00068
00069 $canopen = getGalleryRight('upload');
00070 if ($canopen) {
00071 if (isset($_POST['Send'])) {
00072
00073 $id = Data::toMysql( $_SESSION['course'] );
00074 $description = Data::toMysql( $_POST['description'] );
00075 $en = Data::toMysql( $_POST['en'] );
00076 $boardname = Data::toMysql( $_POST['boardname'] );
00077 $helpdesk = 0;
00078 $filesallowed = 1;
00079 $anonymousallowed = 0;
00080
00081 $photo_view = (int)isset($_POST['photo_view']);
00082 $photo_upload = (int)isset($_POST['photo_upload']);
00083 $photo_edit = (int)isset($_POST['photo_edit']);
00084 $photo_remove = (int)isset($_POST['photo_remove']);
00085
00086 $eins = 0;
00087 $zwei = (int)isset($_POST['II']);
00088 $drei = 0;
00089 $vier = 0;
00090 $fuenf = 0;
00091 $sechs = 0;
00092 $sieben = (int)isset($_POST['VII']);
00093 $acht = (int)isset($_POST['VIII']);
00094 $neun = 0;
00095 $zehn = 0;
00096 $elf = 0;
00097 $zwoelf = 0;
00098 $dreizehn = 0;
00099 $vierzehn = 0;
00100 $fuenfzehn = 0;
00101 $sechszehn = 0;
00102 $siebzehn = 0;
00103 $achtzehn = 0;
00104 $accessmask = $eins.$zwei.$drei.$vier.$fuenf.$sechs.$sieben.$acht.$neun.$zehn.$elf.$zwoelf.$dreizehn.$vierzehn.$fuenfzehn.$sechszehn.$siebzehn.$achtzehn;
00105 $mustsee = (int)isset($_POST['mustsee']);
00106 $result = query("SELECT max(boardorder) FROM forum_board WHERE categoryid=$id AND is_photogallery=1");
00107 list($maxorder) = mysql_fetch_row($result);
00108 $maxorder++;
00109 if ($boardname != "") {
00110 $sql = "insert INTO forum_board (boardname, boarddescription, categoryid, boardorder,
00111 boarddisabled, anonymousallowed, filesallowed, helpdesk, mustsee, is_photogallery) VALUES (
00112 '$boardname', '$description',
00113 '$id', '$maxorder', '$en', $anonymousallowed, $filesallowed, $helpdesk, $mustsee, 1)";
00114
00115 $db->query($sql);
00116 $bid = $db->insert_id;
00117
00118 addBoardRights($id, $bid, $accessmask, $photo_view, $photo_upload, $photo_edit, $photo_remove);
00119
00120 $userid = Data::toMysql( $_SESSION['userid'] );
00121 $db->query("INSERT INTO photogallery_rights (course_id,album_id,usr_id,view,upload,edit,remove,admin) VALUES($id,$bid,$userid,0,0,0,0,1)");
00122 message("", "Fotoalbum \"".Data::toHTML($boardname) ."\" wurde erzeugt.");
00123 } else echo "<div class='error'>Der Name des Albums fehlt!</div>";
00124 } else {
00125 $user_group = $_SESSION['usergroup'];
00126 $destination = "addboard.php";
00127 $action = "newboard";
00128
00129 $accessmask = "111000010000000000";
00130 BoardForm::CreateForm(array(), $accessmask, $action, $user_group, "post", $destination);
00131 }
00132 } else {
00133 echo "<div class='error'>Sie haben kein Recht hier ein Album zu erstellen!</div>";
00134 }
00135 include_once "../footer.inc.php";
00137 require_once (PATH_TO_ROOT."common/footer.inc.php");
00138 ?>